# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=perl-libwww
pkgver=6.57
pkgrel=1
pkgdesc="The World-Wide Web library for Perl"
arch=('any')
url="https://metacpan.org/release/libwww-perl"
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-encode-locale' 'perl-file-listing'
         'perl-html-parser' 'perl-http-cookies' 'perl-http-daemon'
         'perl-http-date' 'perl-http-negotiate' 'perl-lwp-mediatypes'
         'perl-net-http' 'perl-try-tiny' 'perl-uri' 'perl-www-robotrules')
optdepends=('perl-lwp-protocol-https: for https:// url schemes')
checkdepends=('perl-test-fatal' 'perl-test-needs' 'perl-test-requiresinternet')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/O/OA/OALDERS/libwww-perl-$pkgver.tar.gz)
sha512sums=('6d531e00608ee70a12fedb84644e8ce1e6d1fac6631a77e3ec9c3fedfadf171f9929fc73bac265f068d1d557f297e827ddf01a358b5cb42b03ec95462a620812')

build() {
  cd libwww-perl-$pkgver
  perl Makefile.PL --aliases INSTALLDIRS=vendor
  make
}

check()  {
  cd libwww-perl-$pkgver
  make test
}

package() {
  cd libwww-perl-$pkgver
  make DESTDIR="$pkgdir" install
}
